<?php

namespace Library\Widget\Options;

class Option extends \Library\Widget {

	private $_title;
	private $_key;
	private $_group;
	private $_options = array();
	private $_attributes = array();
	
	public function __construct( $key, Group $group ) {
		parent::__construct();
		$this->_key = $key;
		$this->_group = $group;
	}
	
	public function getKey() {
		return $this->_key;
	}
	
	public function setTitle( $title ) {
		$this->_title = $title;
		return $this;
	}
	
	public function getTitle() {
		return $this->_title;
	}
	
	public function getGroup() {
		return $this->_group;
	}
	
	public function getAction() {
		return $this->_attributes['action'];
	}
	
	public function getHref() {
		return $this->_attributes['href'];
	}
	
	public function setAction( $action ) {
		$this->_attributes['action'] = $action;
		return $this;
	}
	
	public function setHref( $url ) {
		$this->_attributes['href'] = $url;
		return $this;
	}
	
	public function setAttribute( $key, $value ) {
		$this->_attributes[ $key ] = $value;
		return $this;
	}
	
	public function getAttributes() {
		return $this->_attributes;
	}
}
